#include <iostream>
#include<vector>
using namespace std;

class Solution {
public:
    int missingNumber(vector<int>& nums) {
        int res = 0, n = nums.size();
        for (int i = 1; i <= n; ++i)res ^= (i ^ nums[i - 1]);
        return res;
    }
};


//int main()
//{
//    Solution a;
//    vector<int> nums = {0,1,2,3,4,6};
//
//    int b = a.missingNumber(nums);
//
//    //cout << b << endl;
//    return 0;
//    
//}